<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>新增栏目</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/css/global.css" media="all">
    <link rel="stylesheet" href="/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/table.css"/>
    <link rel="stylesheet" href="/plugins/layui/css/public.css" media="all" />
    <style>
        .layui-form-label {
            width: 10%;
        }
        .layui-input-block {
            margin-left: 13%;
        }
        .required-field {
            color: red;
            margin-right: 2px;
            font-size: 15px;
            text-align: center;
        }
        img {
            width: 110px;
            height: 110px;
        }
        .layui-upload-list {
            margin-left: 13%;
        }

    </style>
</head>
<body>
<div style="margin: 15px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>k线栏目编辑(<label class="layui-required-tip">标红的为必填项</label>)</legend>
    </fieldset>
    <form class="layui-form" id="layui-form" action="/manage/kline/updatekline" method="post">
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label layui-required-tip">ID：</label>
            <div class="layui-input-block">
                <input type="text" id="id" name="id" value="${kLineTitle.id}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-required-tip">标题名称：</label>
            <div class="layui-input-block">
                <input type="text" id="titleName" name="titleName" lay-verify="required" value="${kLineTitle.titleName}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否默认：</label>
            <div class="layui-input-block" id="isDefault" >
                <#if (kLineTitle.isDefault)?? && kLineTitle.isDefault ==true>
                        <input type="radio" name="isDefault" value="1" title="默认" checked>
                        <input type="radio" name="isDefault" value="0" title="非默认" >
                    <#else>
                        <input type="radio" name="isDefault" value="1" title="默认" >
                        <input type="radio" name="isDefault" value="0" title="非默认" checked>
                </#if>
            </div>
        </div>
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label">是否启用：</label>
            <div class="layui-input-block" id="isEnable" >
                <#if (kLineTitle.isEnable)?? && kLineTitle.isEnable == true >
                        <input type="radio" name="isEnable" value="1" title="启用" checked >
                        <input type="radio" name="isEnable" value="0" title="停用">
                    <#else>
                        <input type="radio" name="isEnable" value="1" title="启用" >
                        <input type="radio" name="isEnable" value="0" title="停用" checked>
                </#if>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="save">立即提交</button>
                <button type="button" class="layui-btn layui-btn-primary" onclick="javascript:history.back();" >返回</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="/plugins/layui/layui.js"></script>
<script type="text/javascript" src="/js/global-config.js"></script>
<script>
    layui.use(['jquery', 'form'], function() {
        var form = layui.form,$ = layui.jquery;

        form.render();

        layer.ready(function () {
            var $layer = $('#layui-form');
            //监听提交监听提交
            form.on('submit(save)', function(data){
                layer.confirm('确认要提交吗？', {
                    btn : [ '确定', '取消' ]//按钮
                }, function(index) {
                    $layer.submit();
                    layer.close(index);
                });
                return false;
            });
        })
    });
</script>
</body>
</html>